home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / program / togvb25.zip / DELPHI.ZIP / TOGGLE25.PAS < prev    next >
Pascal/Delphi Source File  |  1996-01-15  |  7KB  |  177 lines

  1. {********************************************}
  2. {*                                          *}
  3. {* TOGGLE25.PAS generated from TOGGLE25.VBX *}
  4. {*                                          *}
  5. {********************************************}
  6.  
  7. unit Toggle25;
  8.  
  9. interface
  10.  
  11. uses SysUtils, Classes, Graphics, Forms, Controls, VBXCtrl, BIVBX;
  12.  
  13. { $DEFINE InitTToggle}
  14. {^- Remove space to enable default init data -- See documentation. }
  15.  
  16. type
  17.  
  18.   { TToggle }
  19.  
  20.   TToggle = class(TVBXControl)
  21.   protected
  22.     { Event handler }
  23.     procedure HandleVBXEvent(var Message: TWMVBXFireEvent); override;
  24.     procedure DefineProperties(Filer: TFiler); override;
  25.   public
  26.     constructor Create(AOwner: TComponent); override;
  27.  
  28.     property Index: TVBInteger index 0 read GetIntProp;
  29.     property AVersion: Single index 20 read GetSingleProp write SetSingleProp;
  30.     property ZLoad: TVBInteger index 53 read GetIntProp write SetIntProp;
  31.   published
  32.     property BackColor: TColor index 2 read GetColorProp write SetColorProp;
  33.     property Enabled;
  34.     property Visible;
  35.     property MousePointer: TVBEnum index 9 read GetEnumProp write SetEnumProp
  36.       default 0;
  37.     property TabOrder;
  38.     property TabStop;
  39.     property Font;
  40.     property ParentFont;
  41.     property About: TVBString index 21 read GetStringProp {NoRT}write
  42.       SetStringProp stored False;
  43.     property BevelWidth: TVBInteger index 22 read GetIntProp write SetIntProp;
  44.     property BevelInner: TVBEnum index 23 read GetEnumProp write SetEnumProp;
  45.     property BevelOuter: TVBEnum index 24 read GetEnumProp write SetEnumProp;
  46.     property BorderWidth: TVBInteger index 25 read GetIntProp write
  47.       SetIntProp;
  48.     property Value: Boolean index 26 read GetBoolProp write SetBoolProp;
  49.     property OnPicture: TVBPic index 27 read GetPictureProp write
  50.       SetPictureProp stored False;
  51.     property OffPicture: TVBPic index 28 read GetPictureProp write
  52.       SetPictureProp stored False;
  53.     property OnWave: TVBString index 29 read GetStringProp write
  54.       SetStringProp;
  55.     property OffWave: TVBString index 30 read GetStringProp write
  56.       SetStringProp;
  57.     property Sound: Boolean index 31 read GetBoolProp write SetBoolProp;
  58.     property AutoSize: Boolean index 32 read GetBoolProp write SetBoolProp;
  59.     property OnBackColor: TColor index 33 read GetColorProp write
  60.       SetColorProp;
  61.     property OffBackColor: TColor index 34 read GetColorProp write
  62.       SetColorProp;
  63.     property OnCaption: TVBString index 35 read GetStringProp write
  64.       SetStringProp;
  65.     property OffCaption: TVBString index 36 read GetStringProp write
  66.       SetStringProp;
  67.     property OnForeColor: TColor index 37 read GetColorProp write
  68.       SetColorProp;
  69.     property OffForeColor: TColor index 38 read GetColorProp write
  70.       SetColorProp;
  71.     property BlinkMode: TVBEnum index 39 read GetEnumProp write SetEnumProp;
  72.     property BlinkRate: TVBInteger index 40 read GetIntProp write SetIntProp;
  73.     property OnTimer: TVBInteger index 41 read GetIntProp write SetIntProp;
  74.     property MouseControl: Boolean index 42 read GetBoolProp write
  75.       SetBoolProp;
  76.     property TwoState: Boolean index 43 read GetBoolProp write SetBoolProp;
  77.     property Outline: Boolean index 44 read GetBoolProp write SetBoolProp;
  78.     property OutlineColor: TColor index 45 read GetColorProp write
  79.       SetColorProp;
  80.     property OnX: TVBInteger index 46 read GetIntProp write SetIntProp;
  81.     property OnY: TVBInteger index 47 read GetIntProp write SetIntProp;
  82.     property OffX: TVBInteger index 48 read GetIntProp write SetIntProp;
  83.     property OffY: TVBInteger index 49 read GetIntProp write SetIntProp;
  84.     property PushX: TVBInteger index 50 read GetIntProp write SetIntProp;
  85.     property PushY: TVBInteger index 51 read GetIntProp write SetIntProp;
  86.     property PushPicture: TVBPic index 52 read GetPictureProp write
  87.       SetPictureProp stored False;
  88.     property OnClick;
  89.     property OnEnter;
  90.     property OnExit;
  91.     property OnMouseUp;
  92.     property OnMouseDown;
  93.     property OnDragDrop;
  94.     property OnEndDrag;
  95.     property OnMouseMove;
  96.     property OnKeyDown;
  97.     property OnKeyPress;
  98.     property OnKeyUp;
  99.   end;
  100.  
  101. procedure Register;
  102.  
  103. implementation
  104.  
  105. { Default form data for TToggle }
  106.  
  107. {$IFDEF InitTToggle}
  108.  
  109. const
  110.   TToggleInitLen = 134;
  111.  
  112. procedure TToggleInitData; near; assembler;
  113. asm
  114.     DB    $00,$00,$00,$02,$C0,$C0,$C0,$00,$03,$07,$FF,$FF,$08,$FF,$FF,$09
  115.     DB    $00,$0A,$00,$00,$0B,$00,$00,$0C,$00,$0D,$00,$13,$06,$54,$6F,$67
  116.     DB    $67,$6C,$65,$14,$00,$00,$20,$40,$16,$02,$00,$17,$01,$18,$02,$19
  117.     DB    $02,$00,$1A,$00,$00,$1D,$00,$1E,$00,$1F,$00,$00,$20,$00,$00,$21
  118.     DB    $00,$FF,$00,$00,$22,$FF,$00,$00,$00,$23,$02,$4F,$6E,$24,$03,$4F
  119.     DB    $66,$66,$25,$00,$00,$00,$00,$26,$00,$00,$00,$00,$27,$00,$28,$00
  120.     DB    $00,$29,$00,$00,$2A,$FF,$FF,$2B,$00,$00,$2C,$00,$00,$2D,$00,$00
  121.     DB    $00,$00,$2E,$00,$00,$2F,$00,$00,$30,$00,$00,$31,$00,$00,$32,$00
  122.     DB    $00,$33,$00,$00,$35,$FF
  123. end;
  124.  
  125. {$ENDIF}
  126.  
  127. { TToggle }
  128.  
  129. constructor TToggle.Create(AOwner: TComponent);
  130. begin
  131.   FVBXFile := StrNew('TOGGLE25.VBX');
  132.   FVBXClass := StrNew('TOGGLE');
  133.   SetBounds(0, 0, 80, 32);
  134.   inherited Create(AOwner);
  135.   ControlStyle := ControlStyle - [csCaptureMouse, csClickEvents];
  136.   TabStop := True;
  137.   FVBXFlags := [vfLoadMessage];
  138.   {$IFDEF InitTToggle}
  139.   FHForm := VBXCreateFormFile(TToggleInitLen, @TToggleInitData);
  140.   {$ENDIF}
  141. end;
  142.  
  143. procedure TToggle.HandleVBXEvent(var Message: TWMVBXFireEvent);
  144. begin
  145.   case Message.VBXEvent^.EventIndex of
  146.     0: DispatchNotifyEvent(OnClick);
  147.     1: begin end; { VCL Handles OnGotFocus }
  148.     2: begin end; { VCL Handles OnLostFocus }
  149.     3: DispatchMouseEvent(OnMouseUp, Message);
  150.     4: DispatchMouseEvent(OnMouseDown, Message);
  151.     5: begin end; { VCL Handles OnDragDrop }
  152.     6: DispatchMouseMoveEvent(OnMouseMove, Message);
  153.     7: DispatchKeyEvent(OnKeyDown, Message);
  154.     8: DispatchKeyPressedEvent(OnKeyPress, Message);
  155.     9: DispatchKeyEvent(OnKeyUp, Message);
  156.   end;
  157. end;
  158.  
  159. procedure TToggle.DefineProperties(Filer: TFiler);
  160. begin
  161.   inherited DefineProperties(Filer);
  162.   HandleProperty('AVersion', Filer, 20);
  163.   HandleBinaryProperty('OnPicture_Data', Filer, 27);
  164.   HandleBinaryProperty('OffPicture_Data', Filer, 28);
  165.   HandleBinaryProperty('PushPicture_Data', Filer, 52);
  166.   HandleBinaryProperty('ZLoad', Filer, 53);
  167. end;
  168.  
  169. { Designer registration }
  170. procedure Register;
  171. begin
  172.   RegisterComponents('VBX', [
  173.     TToggle]);
  174. end;
  175.  
  176. end.
  177.